home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / gempp19.zoo / gem++19 / src / gemrec.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-28  |  1.2 KB  |  57 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is Copyright 1992,1993 by Warwick W. Allison.
  4. //  This file is part of the gem++ library.
  5. //  You are free to copy and modify these sources, provided you acknowledge
  6. //  the origin by retaining this notice, and adhere to the conditions
  7. //  described in the file COPYING.LIB.
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10.  
  11. #include <aesbind.h>
  12. #include <minmax.h>
  13. #include "gemrec.h"
  14.  
  15. static const RECORDSIZE=16;
  16.  
  17. GEMrecorder::GEMrecorder(int MaxRecordLength) :
  18.     Mylar(new short[MaxRecordLength*RECORDSIZE]),
  19.     MylarLength(MaxRecordLength)
  20. { }
  21.  
  22. GEMrecorder::~GEMrecorder()
  23. {
  24.     delete Mylar;
  25. }
  26.  
  27. void GEMrecorder::Record()
  28. {
  29.     appl_trecord(Mylar,MylarLength);
  30. }
  31.  
  32. void GEMrecorder::Record(int RecordLength)
  33. {
  34.     appl_trecord(Mylar,min(RecordLength,MylarLength));
  35. }
  36.  
  37. void GEMrecorder::Stop()
  38. {
  39.     appl_trecord(0,0);
  40. }
  41.  
  42. void GEMrecorder::Play()
  43. {
  44.     appl_tplay(Mylar,MylarLength,1);
  45. }
  46.  
  47. void GEMrecorder::Play(int Speed)
  48. {
  49.     appl_tplay(Mylar,MylarLength,Speed);
  50. }
  51.  
  52. void GEMrecorder::Play(int Speed, int Amount)
  53. {
  54.     appl_tplay(Mylar,min(Amount,MylarLength),Speed);
  55. }
  56.  
  57.